izmir_fish <- read_rds("https://github.com/yunusemre91/mef05-yunusemre91/raw/4cff5ff2b681a8ae9238dc9e4824ba00834dfeb1/izmir_balik.rds")Before starting to analyze Izmir Fish Market lets first see the structure of the data.
str(izmir_fish)## 'data.frame': 23528 obs. of 7 variables:
## $ X_id : int 1 2 3 4 5 6 7 8 9 10 ...
## $ TARIH : chr "2021-01-02T00:00:00" "2021-01-02T00:00:00" "2021-01-02T00:00:00" "2021-01-02T00:00:00" ...
## $ MAL_TURU : chr "BALIK" "BALIK" "BALIK" "BALIK" ...
## $ MAL_ADI : chr "TIRSI (DENİZ)" "KIRLANGIÇ (DENİZ)" "ÇİMÇİM (DENİZ)" "HANOS ( DENİZ )" ...
## $ BIRIM : chr "KG" "KG" "KG" "KG" ...
## $ ASGARI_UCRET: num 5.83 3 3.5 2.5 45 130 38 25 10 2.5 ...
## $ AZAMI_UCRET : num 12.5 80 8 5 45 130 38 55 10 6.67 ...
izmir_fish$X_id <- NULL
izmir_fish$TARIH <- as.Date(izmir_fish$TARIH)
names(izmir_fish)[1] <- 'Date'
#Adding and moving year-month column and erasing the last column.
izmir_fish<-izmir_fish %>%
mutate(YEARMONTH = format(as.Date(izmir_fish$Date), "%Y-%m"))
izmir_fish$YEARMONTH <- as.yearmon(izmir_fish$YEARMONTH, format="%Y-%m")
izmir_fish <- izmir_fish %>%
mutate(MONTH = format(as.Date(izmir_fish$Date), "%m"))
izmir_fish$MONTH <- as.numeric(as.character(izmir_fish$MONTH))
izmir_fish <- izmir_fish[,c(1,7,8,2,3,4,5,6)]The table below present monthly average price of each fish in the year. Each column can be sorted manually and different fish can be filtered using search box.
Yearly change percentage in prices can be seen from the table below. This percentage is obtained by the ratio of mean maximum price of a fish to the mean minimum price of the fish. Therefore Kerevit (Deniz) has the most volatile price out of 128 different price.
-The graph below shows the monthly average price change of fish by type, BALIK, ITHAL, KULTUR and DONUK. Dashed lines show the mean ASGARI_UCRET change by type.
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'